package io.springboot.jpa.examples.springbootjpaexamples.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @author yzc
 * @description
 * @date 2018/8/31
 */
@Entity
@Table(name = "person")
//@NamedQuery(name = "Person.findByAge", query = "select p from Person p where p.age=?1")
public class Person extends BaseBean implements Serializable {
    private static final long serialVersionUID = -1502232133688303023L;
    private String name;
    private int gender;
    private String idNumber;
    private String mobilePhone;
    private String address;

    @Column(name = "name", length = 10)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "gender", length = 1)
    public int getGender() {
        return gender;
    }

    public void setGender(int gender) {
        this.gender = gender;
    }

    @Column(name = "id_number", length = 18, unique = true)
    public String getIdNumber() {
        return idNumber;
    }

    public void setIdNumber(String idNumber) {
        this.idNumber = idNumber;
    }

    @Column(name = "mobile_phone", length = 11, unique = true)
    public String getMobilePhone() {
        return mobilePhone;
    }

    public void setMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone;
    }

    @Column(name = "address", length = 50)
    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

}
